package ventanas;

import recursos.MaestroInternalFrame;
import recursos.Sesion;

import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JButton;

import controlador.MantenimientoUsuarioController;

public class FIVerifica extends MaestroInternalFrame{
	
	private static final long serialVersionUID = 1L;
	private JLabel lblClave;
	private JPasswordField txtClave;
	private JButton btnValidar;

	public FIVerifica() {
		setVisible(true);
		setSize(179, 125);
		setTitle(Sesion.titulo+"-"+Sesion.tifValidar);
		
		lblClave = new JLabel("Clave:");
		lblClave.setBounds(10, 11, 62, 14);
		contenedorCenter.add(lblClave);
		
		txtClave = new JPasswordField("*");
		txtClave.setBounds(10, 24, 122, 20);
		txtClave.setText("");
		contenedorCenter.add(txtClave);
		
		btnValidar = new JButton("Validar");
		btnValidar.setBounds(10, 44, 122, 23);
		contenedorCenter.add(btnValidar);
		
	}
	
	@SuppressWarnings("deprecation")
	public String getClave(){
		return txtClave.getText().trim();
	}
	
	public JButton getBtnValidar(){
		return btnValidar;
	}
	
	public void setControlador(MantenimientoUsuarioController controlador){
		btnValidar.addActionListener(controlador);
	}
}
